<script lang="ts" setup>
import { ref } from "vue";

defineOptions({
    name: "Child",
});

defineProps(['car', 'sendToy'])
//--================= Data
let toy = ref("奥特曼")

//--================= Methods


//--================= Other


</script>

<template>
    <div class="main2">
        <h4>子组件</h4>
        <h3>玩具:{{ toy }}</h3>
        <hr>
        <h3>父亲给的车：{{ car }}</h3>
        <br>
        <button @click="sendToy(toy)">把玩具给父亲</button>
    </div>


</template>

<style scoped>
.main2 {
    background-color: skyblue;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 0 10px;
    min-height: 400px;
}
</style>
